package com.yxpweb.consumer.service.impl;

import java.util.List;

import bean.UserAddress;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Component;
import service.OrderService;
import service.UserService;


@DubboService(retries = 3)
@Component
public class OrderServiceImpl implements OrderService {

    @DubboReference
    UserService userService;

    public List<UserAddress> initOrder(final String userId) {
        System.out.println(userService.getClass().getSimpleName());

        System.out.println("UserServiceImpl" + userId);
        List<UserAddress> addressList = userService.getUserAddressList(userId);

        return addressList;
    }

    public String getName() {
        return userService.getName();
    }

}
